<?php

use Phinx\Migration\AbstractMigration;

class AddTenantIdInChatTable extends AbstractMigration
{
    public function up()
    {
        $this->table("chat")
            ->addColumn("from_tenant_id", "integer", [
                'default' => 0,
                'null' => false,
                'limit' => 11,
                'comment' => "聊天租户a id"
            ])
            ->addColumn("to_tenant_id", "integer", [
                'default' => 0,
                'null' => false,
                'limit' => 11,
                'comment' => "聊天租户b id"
            ])
            ->save();
    }

    public function down()
    {
        $this->table("chat")
            ->removeColumn("to_tenant_id")
            ->removeColumn("from_tenant_id")
            ->save();
    }
}
